from pydantic import BaseModel
from typing import Generic, TypeVar, Optional

T = TypeVar('T')

class SuccessResponse(BaseModel, Generic[T]):
    status: str = "success"
    code: int = 200
    data: Optional[T] = None

class ErrorResponse(BaseModel):
    status: str = "fail"
    code: int
    message: str